package com.ld.security.auth.server.base.rpc;

import com.ld.security.auth.server.modules.sys.entity.SysLog;
import com.ld.security.auth.server.modules.sys.service.ISysLogService;
import com.ld.security.common.core.base.po.EntitysPo;
import com.ld.security.common.core.base.vo.DataVo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

@RequestMapping("/rpc/log")
@Api(tags="日志记录中心")
@RestController

public class LogRpc {


    @Autowired
    private ISysLogService iSysLogService;

    @RequestMapping(value="/push",method=RequestMethod.POST)
    @ApiOperation("日志记录")
    public DataVo push(@RequestBody EntitysPo<SysLog> po){
        iSysLogService.saveBatch(po.getList());
        DataVo vo = DataVo.of();
        vo.setMessage("日志记录成功");
        return vo;
    }

}
